Open
Conversation
hwookim
reviewed
Dec 17, 2024
|
|
||
| type RequestMethod = 'get' | 'post' | 'put' | 'delete'; | ||
|
|
||
| export const requestHandler = async <R = undefined, T = undefined>( |
There was a problem hiding this comment.
요 친구는 어디에 쓰이는 걸까요?
메소드를 함수형으로 호출하는 대신 string 인자를 통해 전달하는 것이 더 좋은 방식일까요?
Comment on lines
+28
to
+31
| // Redux 상태 초기화 | ||
| dispatch(logout()); | ||
| // 토큰 제거 | ||
| removeToken(); |
There was a problem hiding this comment.
login의 경우에는 reducer 내부에서 토큰을 관리하는데, logout의 경우에는 왜 밖에서 관리할까요?
둘 중 어디가 정답이라고 할 수는 없겠지만, 적어도 양쪽이 같은 방식으로 해야 나중에 코드를 이해하기도 좋을 것 같아요!
그러고보니 login 시에도 미리 선언해둔 setToken 함수를 이용하면 더 좋겠네요 👀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#️⃣연관된 이슈
#23
📝작업 내용
스크린샷 (
선택)
로그인 x
로그인 o

💬리뷰 요구사항(선택)